<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<script type="text/javascript">
$(function() {
    $("textarea[maxlength]").keyup(function() {
        var area = $(this);
        var max = parseInt(area.attr("maxlength"), 10);
        if (max > 0) {
            if (area.val().length > max) { 
                area.val(area.val().substr(0, max)); 
            }
        }
    });
    $("textarea[maxlength]").blur(function() {
        var area = $(this);
        var max = parseInt(area.attr("maxlength"), 10); 
        if (max > 0) {
            if (area.val().length > max) { 
                area.val(area.val().substr(0, max)); 
            }
        }
    });
}); 
</script>

<div id="msg-new-letter" style="margin-top: 10px">
	<div class="sign up2">
		<div class="al-wrp">
			<div class="al-tt clr" id="al-tt">
			给 '${friendUserName}' 的私信
			<textarea class="msg-new-textarea sffocus jqPlaceholder"  placeholder="请输入您要发的私信内容...."  maxlength="1000" id="private_letter_conter_id"></textarea>
			
			</div>
			<div id="fa-creatalb" class="fa-albu-new fa-crttog">
				<div class="l fa-cabinp">
						<a class="abtn abtn-s l" href="javascript:;" target="_self">
						<button class="button sign" onclick="sendLetter();" type="submit">发送</button>
						</a>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
var friendUserId = '${friendUserId}';
var friendUserName = '${friendUserName}';
// 发送短信
var sendLetter = function() {
	if(com.tietiao.Validator.isEmptyStr($("#private_letter_conter_id").attr("value"))) {
		com.tietiao.timeAlert('私信不能为空...',1,true);
		return;
	}
	var content = $("#private_letter_conter_id").attr("value");
	$.post('letter_letter_sendLetter.htm',{friendUserId:friendUserId,content:content},function(data) {
		$.dialog.list['send_letter_view_id'].close();
		com.tietiao.timeAlert('私信发送成功！',1,true);
	});
};
</script>
